/**
 * BomberBoy, CPS240 Term Project - Team A
 * Andrew Osterink, David Bash, Scott Kidder
 * 	
 * Simple tile class that holds the position size and visual attributes.
 * 	later other data will probably need to be added (eg collision attributes).
 */
package pkg;

import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Point;
import java.awt.Rectangle;
public class Tile {
	
	private Rectangle rectangle;
	private Image texture;
	private Color color; //color to use if no texture is specifed
	
	public Tile()
	{
		rectangle = new Rectangle();
		color = Color.blue;
	}
	
	public void render(Graphics2D g)
	{
		if(texture != null)
			g.drawImage(texture, rectangle.x,rectangle.y, rectangle.width, rectangle.height, null);
		else
		{
			g.setColor(Color.blue);
			g.fillRect(rectangle.x, rectangle.y, rectangle.width, rectangle.height);
		}
	}
	
	public Point getPosition()
	{
		return rectangle.getLocation();
	}

	public void setPosition(Point pt)
	{
		rectangle.setLocation(pt);
	}

	public Point getSize()
	{
		return new Point(rectangle.getSize().width,rectangle.getSize().height);
	}
	
	public void setSize(Point pt)
	{
		rectangle.setSize(pt.x, pt.y);
	}
	
	public void setTexture(Image img) {texture = img;}	
	public Image getTexture() { return texture; }
}
